# -*- coding: utf-8 -*-

from google.appengine.api.memcache import Client

cache=Client()


class Cache:
    @staticmethod
    def FlushAll():
        cache.flush_all()
    def __init__(self,cacheName):
        self.cacheName=cacheName
    def get(self):
        return cache.get(self.cacheName)
    def set(self,cacheObject):
        cache.set(self.cacheName, cacheObject, 3600)
    def delete(self):
        """删除缓存"""
        data=self.get()
        if data:
            return cache.delete(self.cacheName)